package club.easin.sq.ctl;

import club.easin.common.DatagridRequestDto;
import club.easin.pow.dto.UserSession;
import club.easin.sq.bl.Feedbackbl;
import club.easin.sq.dto.SqFeedback;
import club.easin.utils.ReturnDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("feedback")
public class FeedbackCtl {

    @Autowired
    private Feedbackbl feedbackbl;

    @RequestMapping("addFeedback")
    @ResponseBody
    public ReturnDto addFeedback(UserSession userSession, @RequestBody SqFeedback sqFeedback){
        return feedbackbl.addFeedback(userSession,sqFeedback);
    }

    @RequestMapping("delFeedBack")
    @ResponseBody
    public ReturnDto delFeedBack(UserSession userSession,String backid){
        return feedbackbl.delFeedback(backid);
    }

    @RequestMapping("editFeedback")
    @ResponseBody
    public ReturnDto edieFeedback(UserSession userSession,@RequestBody SqFeedback sqFeedback){
        return feedbackbl.editFeedack(userSession,sqFeedback);
    }

    @RequestMapping("getFeedbackGrild")
    @ResponseBody
    public ReturnDto getFeedbackGrild(@RequestBody DatagridRequestDto dto){
        return feedbackbl.getFeedbackGrild(dto);
    }

    @RequestMapping("getFeedbackByMaintainid")
    @ResponseBody
    public ReturnDto getFeedbackByMaintainid(String maintainid){
        return feedbackbl.getFeedbackByMaintainid(maintainid);
    }
}
